package com.shangxia.monomer.study.designPatterns.creationType.builder;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * @ProjectName: monomer
 * @ClassName: DefaultFactoryBuilder
 * @Time: 2021/7/19
 * @Author: zhouy
 * @Description:
 * @Experience:
 */

@Slf4j
@Data
@AllArgsConstructor
@NoArgsConstructor
public class DefaultFactoryBuilder extends FactoryBuilder {
    private String name;
    private String area;
    private Integer size;

    /**
     * 实现参数之间的赋值顺序及依赖关系，对外隐藏
     *
     * @return
     */
    @Override
    Factory createFactory(String name, String area, Integer size) {
        Factory factory = new Factory();
        factory.setName(name);
        factory.setArea(area);
        factory.setSize(size);
        return factory;
    }
}
